<h2>Why is this an issue?</h2>
<p>If not annotated with <code>@Nested</code>, an inner class containing some tests will never be executed during tests execution. While you could
still be able to manually run its tests in an IDE, it won’t be the case during the build. By contrast, a static nested class containing some tests
should not be annotated with <code>@Nested</code>, JUnit5 will not share setup and state with an instance of its enclosing class.</p>
<p>This rule raises an issue on inner classes and static nested classes containing JUnit5 test methods which has a wrong usage of <code>@Nested</code>
annotation.</p>
<p>Note: This rule does not check if the context in which JUnit 5 is running (e.g. Maven Surefire Plugin) is properly configured to execute static
nested classes, it could not be the case using the default configuration.</p>
<h3>Noncompliant code example</h3>
<pre>
import org.junit.jupiter.api.Test;

class MyJunit5Test {
  @Test
  void test() { /* ... */ }

  class InnerClassTest { // Noncompliant, missing @Nested annotation
    @Test
    void test() { /* ... */ }
  }

  @Nested
  static class StaticNestedClassTest { // Noncompliant, invalid usage of @Nested annotation
    @Test
    void test() { /* ... */ }
  }
}
</pre>
<h3>Compliant solution</h3>
<pre>
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Nested;

class MyJunit5Test {
  @Test
  void test() { /* ... */ }

  @Nested
  class InnerClassTest {
    @Test
    void test() { /* ... */ }
  }

  static class StaticNestedClassTest {
    @Test
    void test() { /* ... */ }
  }
}
</pre>

